# 111-123
# 常用的类，内置方法也叫魔术方法
'''
__init__
__str__
__lt__
__le__
__eq__
'''


class Student():
    def __init__(self,name,age):
        self.name=name
        self.age=age

    # __str__魔术方法
    def __str__(self):
        return f'Student类对象，name:{self.name}, age:  {self.age}'

    # __lt__魔术方法
    def __lt__(self, other):
        return self.age < other.age

    # __le__魔术方法，<= ， >=
    def __le__(self, other):
        return self.age <= other.age

    # __eq__魔术方法
    def __eq__(self, other):
        return self.age == other.age and self.name == other.name

# stu = Student('zhangsan',19)
# print(stu)
# print(str(stu))

# stu1 = Student('张安',31)
# stu2 = Student('林俊杰',31)
# print(stu1<=stu2)
# print(stu1>=stu2)

stu1 = Student('林俊杰',31)
stu2 = Student('林俊杰',31)
print(stu1==stu2)